package com.netease.pris.activity.a;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.RatingBar;
import android.widget.TextView;
import com.netease.framework.k;
import com.netease.image.d;
import com.netease.pris.activity.view.c;
import com.netease.pris.atom.g;
import com.netease.pris.atom.u;
import java.util.HashMap;

public class ad extends i
{
  public static final int a = 1;
  public static final int b = 2;
  public static final int c = 0;
  public static final int d = 1;
  public static final int e = 2;
  private int f = 0;
  private int g = 0;
  private int h = 0;
  private int i = 0;
  private int j = 0;
  private int k;
  private String[] l = null;
  private int[] m = null;
  private Context n = null;
  private LayoutInflater o = null;
  private View.OnClickListener p = null;
  private HashMap q = null;

  public ad(Context paramContext, int paramInt1, int paramInt2, String[] paramArrayOfString, int[] paramArrayOfInt)
  {
    if (paramContext == null);
    while (true)
    {
      return;
      this.h = paramInt1;
      this.j = paramInt2;
      this.l = paramArrayOfString;
      this.m = paramArrayOfInt;
      this.n = paramContext;
      this.o = LayoutInflater.from(this.n);
      this.q = new HashMap();
    }
  }

  private void a(ag paramag, View paramView)
  {
    if ((paramag == null) || (paramView == null));
    while (true)
    {
      return;
      if ((this.m != null) && (this.l != null))
      {
        int i1 = this.m.length;
        int i2 = 0;
        if (i2 < i1)
        {
          View localView = paramView.findViewById(this.m[i2]);
          if (this.l[i2].equals("icon"))
            paramag.a = ((ImageView)localView);
          while (true)
          {
            i2++;
            break;
            if (this.l[i2].equals("mark"))
            {
              paramag.b = ((ImageView)localView);
              continue;
            }
            if (this.l[i2].equals("title"))
            {
              paramag.c = ((TextView)localView);
              continue;
            }
            if (this.l[i2].equals("content"))
            {
              paramag.e = ((TextView)localView);
              continue;
            }
            if (this.l[i2].equals("ratingbar"))
            {
              paramag.d = ((RatingBar)localView);
              continue;
            }
            if (this.l[i2].equals("button"))
            {
              paramag.h = ((Button)localView);
              paramag.h.setOnClickListener(this.p);
              continue;
            }
            if (!this.l[i2].equals("subs"))
              continue;
            paramag.g = ((TextView)localView);
          }
        }
        paramag.f = ((TextView)paramView.findViewById(2131558552));
        continue;
      }
    }
  }

  private void a(ag paramag, u paramu, int paramInt)
  {
    if ((paramag == null) || (paramu == null));
    while (true)
    {
      return;
      paramag.h.setFocusable(false);
      paramag.h.setClickable(true);
      if (paramu.al())
        label142: if (paramu.S())
        {
          this.i = 2;
          label44: switch (this.i)
          {
          default:
            label76: String str1 = paramu.U();
            paramag.c.setText(str1);
            String str2 = paramu.X();
            paramag.e.setText(str2);
            if (paramu.aS() < 0)
              break;
            paramag.f.setText("" + paramu.aS());
            paramag.d.setNumStars(paramu.ae());
            paramag.d.setRating((float)paramu.ah());
            if ((this.q != null) && (this.q.containsKey(paramu.V())))
              if (((com.netease.pris.atom.aa)this.q.get(paramu.V())).equals(com.netease.pris.atom.aa.a))
              {
                paramag.b.setVisibility(0);
                paramag.h.setText(2131361879);
                paramag.h.setCompoundDrawablesWithIntrinsicBounds(2130837548, 0, 0, 0);
              }
          case 1:
          case 0:
          case 2:
          }
        }
      String str3;
      while (true)
      {
        c localc1 = new c();
        localc1.a = paramu.V();
        localc1.b = paramInt;
        paramag.h.setTag(localc1);
        c localc2 = new c();
        localc1.a += "mark";
        paramag.b.setTag(localc2);
        str3 = paramu.b(g.g);
        if (str3 != null)
          break label657;
        paramag.a.setImageResource(k.a(this.n).a(2130837804));
        break;
        this.i = 0;
        break label44;
        this.i = 1;
        break label44;
        paramag.h.setVisibility(8);
        paramag.d.setVisibility(8);
        paramag.b.setVisibility(8);
        paramag.e.setVisibility(0);
        paramag.g.setVisibility(0);
        break label76;
        paramag.h.setVisibility(0);
        paramag.d.setVisibility(0);
        paramag.e.setVisibility(8);
        paramag.g.setVisibility(8);
        paramag.f.setVisibility(8);
        break label76;
        paramag.h.setVisibility(0);
        paramag.e.setVisibility(0);
        paramag.d.setVisibility(8);
        paramag.g.setVisibility(8);
        paramag.f.setVisibility(8);
        break label76;
        paramag.f.setVisibility(8);
        break label142;
        if (!((com.netease.pris.atom.aa)this.q.get(paramu.V())).equals(com.netease.pris.atom.aa.b))
          continue;
        paramag.b.setVisibility(8);
        paramag.h.setText(2131361909);
        paramag.h.setCompoundDrawablesWithIntrinsicBounds(2130837547, 0, 0, 0);
        continue;
        if (paramu.aj().equals(com.netease.pris.atom.aa.a))
        {
          paramag.b.setVisibility(0);
          paramag.h.setText(2131361879);
          paramag.h.setCompoundDrawablesWithIntrinsicBounds(2130837548, 0, 0, 0);
          continue;
        }
        paramag.b.setVisibility(8);
        paramag.h.setText(2131361909);
        paramag.h.setCompoundDrawablesWithIntrinsicBounds(2130837547, 0, 0, 0);
      }
      label657: paramag.a.setImageResource(k.a(this.n).a(2130837804));
      StringBuilder localStringBuilder = new StringBuilder();
      paramag.a.setTag(localStringBuilder);
      d.a().a(localStringBuilder, 1, str3, new aa(this, paramag), -1, -1, 2, this.k);
    }
  }

  public com.netease.pris.atom.aa a(String paramString)
  {
    if (this.q != null);
    for (com.netease.pris.atom.aa localaa = (com.netease.pris.atom.aa)this.q.get(paramString); ; localaa = com.netease.pris.atom.aa.c)
      return localaa;
  }

  public void a(View.OnClickListener paramOnClickListener)
  {
    this.p = paramOnClickListener;
  }

  public void a(com.netease.pris.atom.aa paramaa, String paramString)
  {
    if (this.q != null)
      this.q.put(paramString, paramaa);
  }

  public void b()
  {
    super.a();
    c();
    this.p = null;
    this.l = null;
    this.m = null;
    this.o = null;
    this.n = null;
  }

  public void b(int paramInt)
  {
    this.h = paramInt;
  }

  public void c()
  {
    if (this.q != null)
      this.q.clear();
  }

  public void c(int paramInt)
  {
    this.f = paramInt;
  }

  public void d(int paramInt)
  {
    this.g = paramInt;
  }

  public void e(int paramInt)
  {
    this.k = paramInt;
  }

  public u f(int paramInt)
  {
    if (1 == this.h)
      paramInt += this.f;
    return (u)super.getItem(paramInt);
  }

  public int getCount()
  {
    if (1 == this.h);
    for (int i1 = this.g; ; i1 = super.getCount())
      return i1;
  }

  public View getView(int paramInt, View paramView, ViewGroup paramViewGroup)
  {
    ag localag;
    if ((paramView != null) && ((paramView.getTag() instanceof ag)))
      localag = (ag)paramView.getTag();
    while (true)
    {
      u localu = f(paramInt);
      if (localu != null)
        a(localag, localu, paramInt);
      return paramView;
      paramView = this.o.inflate(this.j, null);
      localag = new ag(this);
      a(localag, paramView);
      paramView.setTag(localag);
    }
  }
}

/* Location:           D:\android\hack\dex2jar-0.0.9.8\classes_dex2jar.jar
 * Qualified Name:     com.netease.pris.activity.a.ad
 * JD-Core Version:    0.6.0
 */